//
//  HYDateButtonView.m
//  TJHYHardwareProduct
//
//  Created by Kendama on 2018/1/22.
//  Copyright © 2018年 Kendama. All rights reserved.
//

#import "HYDateButtonView.h"

@implementation HYDateButtonView

- (UILabel *)dateLabel
{
    if(!_dateLabel)
    {
        UIView *superView = self;
        _dateLabel = [[UILabel alloc]init];
        [superView addSubview:_dateLabel];
        [_dateLabel setFont:fontWithSize(14)];
        [_dateLabel setTextColor:[UIColor darkGrayColor]];
    }
    return _dateLabel;
}
- (UIImageView *)iconImageView
{
    if(!_iconImageView)
    {
        UIView *superView = self;
        _iconImageView = [[UIImageView alloc]init];
        [superView addSubview:_iconImageView];
        _iconImageView.image = [UIImage imageNamed:@"date"];
    }
    return _iconImageView;
}

- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    

    
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(superView.mas_right).with.offset(-px1080Width(20));
        make.centerY.mas_equalTo(superView.mas_centerY);
    }];
    
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.right.mas_equalTo(_iconImageView.mas_left).with.offset(-px1080Width(20));
    }];
}


@end
